<?php

namespace Sofical\Restphp\exception;

use restphp\exception\RestException;

class BaException extends RestException {
    public function __construct($strBaCode, $intHttpStatus = 400, $arrGroupArgs = array()) {
        $appName = defined('APP_NAME') ? APP_NAME : 'RESTPHP';
        parent::__construct("[" . $strBaCode . "]",   $appName . "/" . $strBaCode, $intHttpStatus, $arrGroupArgs);
    }

    public static function throwRuntimeException($strBaCode, $arrArgs = array(), $intHttpStatus = 400) {
        throw new self($strBaCode, $intHttpStatus, $arrArgs);
    }
}